home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
program
/
vb_eliza.zip
/
MAIN.FRM
< prev
next >
Wrap
Text File
|
1996-07-30
|
5KB
|
158 lines
VERSION 4.00
Begin VB.Form frmMain
BorderStyle = 3 'Fixed Dialog
Caption = "Talk to ELIZA"
ClientHeight = 4140
ClientLeft = 765
ClientTop = 1905
ClientWidth = 7845
ControlBox = 0 'False
Height = 4545
Left = 705
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4140
ScaleWidth = 7845
ShowInTaskbar = 0 'False
Top = 1560
Width = 7965
Begin VB.TextBox txtQuestion
Height = 285
Left = 1680
TabIndex = 0
Top = 3120
Width = 6015
End
Begin VB.CommandButton cmdExit
Caption = "E&xit"
Height = 375
Left = 4560
TabIndex = 2
Top = 3600
Width = 1455
End
Begin VB.CommandButton cmdOK
Caption = "OK"
Height = 375
Left = 2520
TabIndex = 1
Top = 3600
Width = 1455
End
Begin VB.Label Label3
Caption = "Your conversation with ELIZA:"
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 7
Top = 120
Width = 1455
End
Begin VB.Label Label2
Caption = "ELIZA replies:"
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 6
Top = 2400
Width = 1455
End
Begin VB.Label Label1
Caption = "Type your question here:"
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 5
Top = 3000
Width = 1455
End
Begin VB.Label lblReply
BorderStyle = 1 'Fixed Single
Height = 375
Left = 1680
TabIndex = 4
Top = 2400
Width = 6015
End
Begin VB.Label lblConversation
BorderStyle = 1 'Fixed Single
Height = 2055
Left = 1680
TabIndex = 3
Top = 120
Width = 6015
End
End
Attribute VB_Name = "frmMain"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Dim Counter As Integer
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdOK_Click()
HandleReply
txtQuestion.SetFocus
End Sub
Private Sub Form_Load()
lblReply.Caption = Greeting
End Sub
Private Sub txtQuestion_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
HandleReply
End If
End Sub
Public Sub HandleReply()
Const LOWER = 1
Const UPPER = 10
Static TalkArray(LOWER To UPPER) As String
Dim OldReply As String
Dim TempString As String
NL = Chr(10) & Chr(13)
OldReply = lblReply.Caption
If lblConversation.Caption <> "" Then
For I = LOWER To UPPER - 2
TalkArray(I) = TalkArray(I + 2)
Next I
End If
TalkArray(9) = "ELIZA: " & lblReply.Caption
TalkArray(10) = txtQuestion.Text
TempString = ""
For I = LOWER To UPPER
TempString = TempString & TalkArray(I) & NL
Next I
lblConversation.Caption = TempString
lblReply.Caption = NewReply(OldReply, txtQuestion.Text)
txtQuestion.Text = ""
End Sub